package com.example.demo1010.demo1;

public class Rectangle implements Measurement{
    int sideA;
    int sideB;

    public Rectangle(int sideA,int sideB) {
        this.sideA = sideA;
        this.sideB=sideB;
    }

    @Override
    public double area() {
        System.out.println("长方形的面积为" + sideA * sideB);
        return sideA * sideB;
    }

    @Override
    public double perimeter() {
        System.out.println("长正方形的周长为" + (sideA*2+sideB*2));
        return (sideA*2)+(sideB*2);
    }
}
